<?php

class Application_Form_Login extends Zend_Form
{

    public function init()
    {
        $this->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array(), 'login'));
        $this->setMethod('post');

        $this->addElement('text', 'username', array(
            'label' => 'Username',
            'required' => true,
            'filters'    => array('StringTrim'),
        ));
        $this->addElement('password', 'password', array(
            'label' => 'Password',
            'required' => true
        ));

        $this->addElement('submit', 'submit', array(
            'ignore'   => true,
            'label'    => 'Login',
        ));

        $this->addElement('hash', 'csrf', array(
            'ignore' => true,
            'salt' => 'form_login_salt'
        ));
    }


}

